<template>
	<view class="content">
		<text style="font-size: 36rpx; font-weight: bold;">子组件A</text>
		<view class="coma_box" style="margin-top: 20rpx; margin-left: 30rpx;">
			<text>父组件传进来的值:</text>
			<text style="font-weight: bold; color: red; margin-left: 10rpx;">{{ intent }}</text>
		</view>
		<button type="primary" @click="sendData()"
			style="margin-top: 30rpx; margin-left: 30rpx; width: 60%;">传值给CompB组件</button>
	</view>
</template>

<script>
	export default {
		props: ['intent'],
		methods: {
			sendData() {
				console.warn("----子组件A发送数据给B-->", this.intent);
				uni.$emit('getIntent', this.intent);
			}
		}
	}
</script>

<style scoped>
	.content {
		background-color: #f5f5f5;
		padding: 20rpx;
		border-radius: 10rpx;
		margin: 0 30rpx;
	}
</style>